<?php
use yii\helpers\Url;

?>

    <link href="/backend/css/new-business.css" rel="stylesheet">
    <!-- 引入 echarts.js -->

    <div class="row">
        <div class=" lh30">
            <?= $this->render('../_nav'); ?>
        </div>
    </div>

    <section class="container" style="padding-top:10px;">

        <div id="myTabContent" class="tab-content">
            <!--  business noe     -->
            <div class="tab-row">
                <?= $this->render('../_financial_data'); ?>
                <div class="tab-row-tow" id="tab-row-tow">
                    <!--   营业收入       -->
                    <a href="<?= Url::toRoute(['financial/cashier', 'action' => 'saleamount', 'searchTime' => Yii::$app->request->get()['searchTime'], 'start_time' => Yii::$app->request->get()['start_time'],  'end_time' => Yii::$app->request->get()['end_time']]) ?>">
                        <div class="ml0 tab-row-box fl">
                            <div class="tab-box-icon h">
                                <img src="/backend/img/financial/income_ico.png" class=" d-none">
                                <img src="/backend/img/financial/income_ico1.png" class="">
                            </div>
                            <div class="tab-box-text ">
                                <span style="font-size: 16px;">营业收入<em style="color: #c3a279">￥<?php echo $other_common['consumeList'][0]['consume_amount'] ? $other_common['consumeList'][0]['consume_amount'] : '0.00'; ?>元</em></span>
                                <span style="font-size: 13px;">现金:<em style="color: #fe7b9d">￥<?php echo $other_common['consumeList'][0]['cash_pay'] ? $other_common['consumeList'][0]['cash_pay'] : '0.00'; ?>元</em></span>
                                <span style="font-size: 13px;">刷卡:<em style="color: #fe7b9d">￥<?php echo $other_common['consumeList'][0]['unionpay'] ? $other_common['consumeList'][0]['unionpay'] : '0.00'; ?>元 </em></span>
                            </div>
                        </div>
                    </a>
                    <!--   到店会员       -->
                    <a href="<?= Url::toRoute(['financial/cashier', 'action' => 'one', 'searchTime' => Yii::$app->request->get()['searchTime'], 'start_time' => Yii::$app->request->get()['start_time'],  'end_time' => Yii::$app->request->get()['end_time']]) ?>">
                        <div class="tab-row-box fl">
                            <div class="tab-box-icon y">
                                <img src="/backend/img/financial/store_ico.png" class="d-none">
                                <img src="/backend/img/financial/store_ico1.png" class="">
                            </div>
                            <div class="tab-box-text ">
                                <span style="font-size: 16px;">到店会员：<em style="color: #c3a279"><?php echo $other_common['come_member']; ?></em></span>
                                <span style="font-size: 13px;">新增会员：<em style="color: #c3a279"><?php echo $other_common['bus_members'][0]['member_id']; ?></em></span>
                            </div>
                        </div>
                    </a>
                    <!--   消化金额       -->
                    <a href="<?= Url::toRoute(['financial/cashier', 'action' => 'two', 'searchTime' => Yii::$app->request->get()['searchTime'], 'start_time' => Yii::$app->request->get()['start_time'],  'end_time' => Yii::$app->request->get()['end_time']]) ?>">
                        <div class="tab-row-box   fl">
                            <div class="tab-box-icon z ">
                                <img src="/backend/img/financial/consume_ico.png" class=" d-none">
                                <img src="/backend/img/financial/consume_ico1.png" class="">
                            </div>
                            <div class="tab-box-text ">
                                <span style="font-size: 16px;">消耗金额</span>
                                <span
                                    style="font-size: 13px;"><em style="color: #c3a279">￥<?php echo $other_common['bus_service_extends'][0]['consume_amount'] ? $other_common['bus_service_extends'][0]['consume_amount'] : '0.00'; ?>
                                    元</em></span>
                            </div>
                        </div>
                    </a>
                    <!--   手工提成       -->
                    <a href="<?= Url::toRoute(['financial/cashier', 'action' => 'three', 'searchTime' => Yii::$app->request->get()['searchTime'], 'start_time' => Yii::$app->request->get()['start_time'],  'end_time' => Yii::$app->request->get()['end_time']]) ?>">
                        <div class="tab-row-box current fl">
                            <div class="tab-box-icon current ">
                                <img src="/backend/img/financial/manual_ico.png" class="">
                                <img src="/backend/img/financial/manual_ico1.png" class=" d-none">
                            </div>
                            <div class="tab-box-text current ">
                                <span style="font-size: 16px;">手工提成</span>
                                <span><em style="color: #c3a279">￥<?php echo $other_common['sum_handwork_reward'][0]['handwork_reward'] ? $other_common['sum_handwork_reward'][0]['handwork_reward'] : '0.00'; ?>
                                    元</em></span>
                            </div>
                        </div>
                    </a>
                </div>
            </div>
            <!--  business tow      -->
            <div class="clearfix"></div>
            <div class="tab-list">

                <!--  business-list public   -->
                <div class="tab-list-box">
                    <div class="title">
                        <span>手工提成</span>
                    </div>
                    <div class="b-none">
                        <div id="main1" style="height:350px; border: 1px solid #dedede; margin-top: 20px;"></div>
                        <script type="text/javascript">
                            // 基于准备好的dom，初始化echarts实例
                            var myChart = echarts.init(document.getElementById('main1'));
                            // 指定图表的配置项和数据
                            option = {
                                title: {},
                                legend: {},
                                grid: {
                                    width: '85%',
                                    left: 80,
                                    containLabel: false,
                                },
                                xAxis: {
                                    name: '美容师',
                                    data: [
                                        <?php foreach($BusEmployeeRewards as $v) { ?>
                                        "<?php echo $v['employee_name'];?>",
                                        <?php } ?>
                                    ],

                                    nameTextStyle: {
                                        color:'#6f6f6f' ,
                                        fontSize:'12px',
                                    },
                                    nameGap:'25',
                                    splitLine: {
                                        show: false
                                    },
                                    axisLine: {
                                        show:false,
                                        lineStyle: {
                                            color: '#e5e5e5'
                                        }
                                    },
                                    axisTick: {
                                        show: false
                                    },
                                },
                                yAxis: {
                                    name: '手工提成',
                                    type: 'value',
                                    min: 0,
                                    nameTextStyle: {
                                        color:'#6f6f6f' ,
                                        fontSize:'12px',
                                    },
                                    nameGap:'25',
                                    axisLine: {
                                        show: false,
                                        lineStyle: {
                                            color: '#e5e5e5'
                                        }
                                    },
                                    axisTick: {
                                        show: false
                                    },
                                    splitLine: {
                                        lineStyle:{
                                            type:'dashed'
                                        }
                                    }
                                },
                                series: [{
                                    type: 'bar',
                                    barMinHeight:5,
                                    barWidth: 80,
                                    barMaxWidth:80,
                                    label: {
                                        normal: {
                                            show: true,
                                            formatter: '￥{c}',
                                            position: 'top',
                                            textStyle:{
                                                color:'#6f6f6f',
                                            }
                                        }
                                    },
                                    data: [
                                        <?php
                                        foreach($BusEmployeeRewards as $k => $v) {
                                        ?>
                                        {
                                            value:<?php echo $v['consume_reward']?$v['consume_reward']:'0.00';?>,
                                            name: '<?php echo $v["employee_name"];?>',
                                            itemStyle: {
                                                normal: {
                                                    show:false,
                                                    color: new echarts.graphic.LinearGradient(0, 0, 0, 0.8, [{
                                                        offset: 0,
                                                        color: '#f78ca8'
                                                    }, {
                                                        offset: 1,
                                                        color: '#fce5a2'
                                                    }])
                                                }
                                            },
                                        },
                                        <?php } ?>
                                    ]
                                }]
                            };
                            // 使用刚指定的配置项和数据显示图表。
                            myChart.setOption(option);
                        </script>
                    </div>
                    <div class="clearfix"></div>

                </div>

            </div>
    </section>

<?php $this->registerJsFile("@web/libs/echarts/echarts.js", ['position' => $this::POS_HEAD]); ?>